package com.xjscrm.common.enums;


/**
 * 租户状态
 * @author JiangHam
 */
public enum TenantStatusEnum {
    /**
     * 1 有效
     */
    VALID(1,"有效"),
    /**
     * 过期
     */
    INVALID(2,"过期");

    private Integer value;
    private String desc;

    TenantStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static TenantStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (TenantStatusEnum type: TenantStatusEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
